/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dava.testmodel;


import java.util.ArrayList;
import java.util.List;



/**
 *
 * @author dava
 */
public class Organisation {

    /**
     * The organisation identifier in EVITEL.
     */
    private String id;

    private List<Subject> subjects = new ArrayList<Subject>();
    
    private List<Phone> phones = new ArrayList<Phone>();

    /**
     * Creates new default organisation entity with its EVITEL identifier specified.
     *
     * @param id the organisation identifier in EVITEL, must not be null, otherwise
     *           IllegalArgumentException is thrown
     */
    public Organisation(final String id) {
        if (id == null) {
            throw new IllegalArgumentException("parameter must not be null");
        } else {
            this.id = id;
        }
    }
    
    public void addSubject(Subject sub){
        this.subjects.add(sub);
        this.phones.addAll(sub.getPhones());
    }

    public List<Phone> getAllPhones() {
        return phones;
    }
    
    

}
